package com.ruirui.block;

import reactor.core.publisher.Flux;
import reactor.core.scheduler.Schedulers;

import java.util.List;

public class Block {
    public static void main(String[] args) {
        //重新收集成列表
        List<Integer> block = Flux.just(1, 2, 3)
                .map(e -> e * 2)
                .collectList()
                .block();

        //paralleFlux
        Flux.range(1,100)
                .buffer(5)
                .parallel(8)
                .runOn(Schedulers.newParallel("xx"))
                .log()
                .flatMap(e -> Flux.fromIterable(e))
                .collectSortedList(Integer::compareTo)
                .subscribe(e -> System.out.println("e:" + e));





    }
}
